home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch7p < prev    next >
Encoding:
Internet Message Format  |  1990-02-26  |  56.4 KB

  1. Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v09i016:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch7p
  5. Message-ID: <5230@tekred.CNA.TEK.COM>
  6. Date: 24 Feb 90 00:59:17 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 2277
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 9, Issue 16
  13. Archive-name: NetHack3/Patch7p
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 16 (of 30)."
  25. # Contents:  patch7.21
  26. # Wrapped by billr@saab on Wed Feb 21 10:04:37 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patch7.21' -a "${1}" != "-c" ; then 
  29.   echo shar: Renaming existing file \"'patch7.21'\" to \"'patch7.21.orig'\"
  30.   mv -f 'patch7.21' 'patch7.21.orig'
  31. fi
  32. echo shar: Extracting \"'patch7.21'\" \(53640 characters\)
  33. sed "s/^X//" >'patch7.21' <<'END_OF_FILE'
  34. X*** src/Old/timeout.c    Mon Feb 19 19:02:27 1990
  35. X--- src/timeout.c    Thu Jan 25 22:14:40 1990
  36. X***************
  37. X*** 1,9 ****
  38. X! /*    SCCS Id: @(#)timeout.c    3.0    87/07/06
  39. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  40. X  /* NetHack may be freely redistributed.  See license for details. */
  41. X  
  42. X  #include    "hack.h"
  43. X  
  44. X  /* He is being petrified - dialogue by inmet!tower */
  45. X  static const char *stoned_texts[] = {
  46. X      "You are slowing down.",        /* 5 */
  47. X--- 1,16 ----
  48. X! /*    SCCS Id: @(#)timeout.c    3.0    89/11/20
  49. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  50. X  /* NetHack may be freely redistributed.  See license for details. */
  51. X  
  52. X  #include    "hack.h"
  53. X  
  54. X+ #ifdef OVERLAY
  55. X+ extern void NDECL(stoned_dialog), NDECL(vomiting_dialog), NDECL(choke_dialog);
  56. X+ extern void FDECL(hatch_it, (struct obj*));
  57. X+ #endif
  58. X+ 
  59. X+ #ifdef OVLB
  60. X+ 
  61. X  /* He is being petrified - dialogue by inmet!tower */
  62. X  static const char *stoned_texts[] = {
  63. X      "You are slowing down.",        /* 5 */
  64. X***************
  65. X*** 13,19 ****
  66. X      "You are a statue."            /* 1 */
  67. X  };
  68. X  
  69. X! static void
  70. X  stoned_dialogue() {
  71. X      register long i = (Stoned & TIMEOUT);
  72. X  
  73. X--- 20,26 ----
  74. X      "You are a statue."            /* 1 */
  75. X  };
  76. X  
  77. X! XSTATIC void
  78. X  stoned_dialogue() {
  79. X      register long i = (Stoned & TIMEOUT);
  80. X  
  81. X***************
  82. X*** 34,40 ****
  83. X      "You suddenly vomit!"            /* 0 */
  84. X  };
  85. X  
  86. X! static void
  87. X  vomiting_dialogue() {
  88. X      register long i = (Vomiting & TIMEOUT) / 3L;
  89. X  
  90. X--- 41,47 ----
  91. X      "You suddenly vomit!"            /* 0 */
  92. X  };
  93. X  
  94. X! XSTATIC void
  95. X  vomiting_dialogue() {
  96. X      register long i = (Vomiting & TIMEOUT) / 3L;
  97. X  
  98. X***************
  99. X*** 42,48 ****
  100. X         i >= 0 && i < SIZE(vomiting_texts))
  101. X          pline(vomiting_texts[SIZE(vomiting_texts) - i]);
  102. X  
  103. X!     switch(i) {
  104. X  
  105. X          case 0:    vomit(); morehungry(20); break;
  106. X          case 2:    make_confused(HConfusion + d(2,4), FALSE);
  107. X--- 49,55 ----
  108. X         i >= 0 && i < SIZE(vomiting_texts))
  109. X          pline(vomiting_texts[SIZE(vomiting_texts) - i]);
  110. X  
  111. X!     switch((int)i) {
  112. X  
  113. X          case 0:    vomit(); morehungry(20); break;
  114. X          case 2:    make_confused(HConfusion + d(2,4), FALSE);
  115. X***************
  116. X*** 59,65 ****
  117. X      "You suffocate."
  118. X  };
  119. X  
  120. X! static void
  121. X  choke_dialogue()
  122. X  {
  123. X      register long i = (Strangled & TIMEOUT);
  124. X--- 66,72 ----
  125. X      "You suffocate."
  126. X  };
  127. X  
  128. X! XSTATIC void
  129. X  choke_dialogue()
  130. X  {
  131. X      register long i = (Strangled & TIMEOUT);
  132. X***************
  133. X*** 69,74 ****
  134. X--- 76,84 ----
  135. X              hcolor() : blue);
  136. X  }
  137. X  
  138. X+ #endif /* OVLB */
  139. X+ #ifdef OVL0
  140. X+ 
  141. X  void
  142. X  timeout()
  143. X  {
  144. X***************
  145. X*** 105,112 ****
  146. X          if(upp->p_tofn) (*upp->p_tofn)();
  147. X          else switch(upp - u.uprops){
  148. X          case STONED:
  149. X!             if (!killer) killer = "cockatrice";
  150. X!             done(STONING);
  151. X              break;
  152. X          case VOMITING:
  153. X              make_vomiting(0L, TRUE);
  154. X--- 115,124 ----
  155. X          if(upp->p_tofn) (*upp->p_tofn)();
  156. X          else switch(upp - u.uprops){
  157. X          case STONED:
  158. X!             if (!killer) {
  159. X!                 killer_format = KILLED_BY_AN;
  160. X!                 killer = "cockatrice";
  161. X!             } done(STONING);
  162. X              break;
  163. X          case VOMITING:
  164. X              make_vomiting(0L, TRUE);
  165. X***************
  166. X*** 113,118 ****
  167. X--- 125,131 ----
  168. X              break;
  169. X          case SICK:
  170. X              You("die from your illness.");
  171. X+             killer_format = KILLED_BY_AN;
  172. X              killer = u.usick_cause;
  173. X              done(POISONING);
  174. X              break;
  175. X***************
  176. X*** 155,160 ****
  177. X--- 168,174 ----
  178. X              }
  179. X              break;
  180. X          case STRANGLED:
  181. X+             killer_format = KILLED_BY;
  182. X              killer = "strangulation";
  183. X              done(DIED);
  184. X              break;
  185. X***************
  186. X*** 191,199 ****
  187. X      }
  188. X  }
  189. X  
  190. X! static const char slithy[] = { S_SNAKE, S_NAGA, S_WORM, 0 };
  191. X  
  192. X! static void
  193. X  hatch_it(otmp)        /* hatch the egg "otmp" if possible */
  194. X  register struct obj *otmp;
  195. X  {
  196. X--- 205,214 ----
  197. X      }
  198. X  }
  199. X  
  200. X! #endif /* OVL0 */
  201. X! #ifdef OVLB
  202. X  
  203. X! XSTATIC void
  204. X  hatch_it(otmp)        /* hatch the egg "otmp" if possible */
  205. X  register struct obj *otmp;
  206. X  {
  207. X***************
  208. X*** 215,227 ****
  209. X  
  210. X          if(Blind)
  211. X              You("feel something %s from your pack!",
  212. X!               (index(slithy, mtmp->data->mlet)) ?
  213. X!                   "slither" : "drop");
  214. X          else
  215. X!             pline("%s just %s out of your pack!",
  216. X!               An(mtmp->data->mname),
  217. X!               (index(slithy, mtmp->data->mlet)) ?
  218. X!                   "slithered" : "dropped");
  219. X  
  220. X  #ifdef POLYSELF
  221. X          if (yours) {
  222. X--- 230,240 ----
  223. X  
  224. X          if(Blind)
  225. X              You("feel something %s from your pack!",
  226. X!             locomotion(mtmp->data, "drop"));
  227. X          else
  228. X!             You("see %s %s out of your pack!",
  229. X!             an(mtmp->data->mname),
  230. X!             locomotion(mtmp->data, "drop"));
  231. X  
  232. X  #ifdef POLYSELF
  233. X          if (yours) {
  234. X***************
  235. X*** 240,245 ****
  236. X--- 253,261 ----
  237. X      }
  238. X  }
  239. X  
  240. X+ #endif /* OVLB */
  241. X+ #ifdef OVL1
  242. X+ 
  243. X  void
  244. X  hatch_eggs()        /* hatch any eggs that have been too long in pack */
  245. X  {
  246. X***************
  247. X*** 264,266 ****
  248. X--- 280,284 ----
  249. X      }
  250. X  */
  251. X  }
  252. X+ 
  253. X+ #endif /* OVL1 */
  254. X*** src/Old/topl.c    Mon Feb 19 19:02:45 1990
  255. X--- src/topl.c    Mon Feb 19 10:18:54 1990
  256. X***************
  257. X*** 2,21 ****
  258. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  259. X  /* NetHack may be freely redistributed.  See license for details. */
  260. X  
  261. X! #define NEED_VARARGS
  262. X  #include "hack.h"
  263. X  
  264. X! char toplines[BUFSIZ];
  265. X  xchar tlx, tly;            /* set by pline; used by addtopl */
  266. X! static boolean no_repeat = FALSE;
  267. X  
  268. X! struct topl {
  269. X      struct topl *next_topl;
  270. X      char *topl_text;
  271. X  } *old_toplines, *last_redone_topl;
  272. X  #define    OTLMAX    20        /* max nr of old toplines remembered */
  273. X  
  274. X! static void
  275. X  redotoplin() {
  276. X      home();
  277. X      if(index(toplines, '\n')) cl_end();
  278. X--- 2,35 ----
  279. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  280. X  /* NetHack may be freely redistributed.  See license for details. */
  281. X  
  282. X! #define NEED_VARARGS /* Uses ... */    /* comment line for pre-compiled headers */
  283. X  #include "hack.h"
  284. X  
  285. X! VSTATIC char toplines[BUFSIZ];
  286. X! 
  287. X! #ifndef OVLB
  288. X! OSTATIC boolean no_repeat;
  289. X! #else /* OVLB */
  290. X! XSTATIC boolean no_repeat = FALSE;
  291. X! #endif /* OVLB */
  292. X! 
  293. X! extern xchar tlx, tly;
  294. X! #ifdef OVLB
  295. X  xchar tlx, tly;            /* set by pline; used by addtopl */
  296. X! #endif /* OVLB */
  297. X  
  298. X! OSTATIC void NDECL(redotoplin);
  299. X! OSTATIC void FDECL(xmore,(const char *));
  300. X! VSTATIC struct topl {
  301. X      struct topl *next_topl;
  302. X      char *topl_text;
  303. X  } *old_toplines, *last_redone_topl;
  304. X+ 
  305. X  #define    OTLMAX    20        /* max nr of old toplines remembered */
  306. X  
  307. X! #ifdef OVL1
  308. X! 
  309. X! XSTATIC void
  310. X  redotoplin() {
  311. X      home();
  312. X      if(index(toplines, '\n')) cl_end();
  313. X***************
  314. X*** 35,40 ****
  315. X--- 49,57 ----
  316. X          more();
  317. X  }
  318. X  
  319. X+ #endif /* OVL1 */
  320. X+ #ifdef OVLB
  321. X+ 
  322. X  int
  323. X  doredotopl(){
  324. X      if(last_redone_topl)
  325. X***************
  326. X*** 48,53 ****
  327. X--- 65,73 ----
  328. X      return 0;
  329. X  }
  330. X  
  331. X+ #endif /* OVLB */
  332. X+ #ifdef OVL1
  333. X+ 
  334. X  void
  335. X  remember_topl() {
  336. X      register struct topl *tl;
  337. X***************
  338. X*** 74,80 ****
  339. X  }
  340. X  
  341. X  void
  342. X! addtopl(s) char *s; {
  343. X      curs(tlx,tly);
  344. X      if(tlx + strlen(s) > CO) putsym('\n');
  345. X      putstr(s);
  346. X--- 94,102 ----
  347. X  }
  348. X  
  349. X  void
  350. X! addtopl(s)
  351. X! const char *s;
  352. X! {
  353. X      curs(tlx,tly);
  354. X      if(tlx + strlen(s) > CO) putsym('\n');
  355. X      putstr(s);
  356. X***************
  357. X*** 83,91 ****
  358. X      flags.toplin = 1;
  359. X  }
  360. X  
  361. X! static void
  362. X  xmore(s)
  363. X! char *s;    /* allowed chars besides space/return */
  364. X  {
  365. X      if(flags.toplin) {
  366. X          curs(tlx, tly);
  367. X--- 105,116 ----
  368. X      flags.toplin = 1;
  369. X  }
  370. X  
  371. X! #endif /* OVL1 */
  372. X! #ifdef OVL2
  373. X! 
  374. X! XSTATIC void
  375. X  xmore(s)
  376. X! const char *s;    /* allowed chars besides space/return */
  377. X  {
  378. X      if(flags.toplin) {
  379. X          curs(tlx, tly);
  380. X***************
  381. X*** 104,109 ****
  382. X--- 129,135 ----
  383. X          cl_end();
  384. X          docorner(1, tly-1);
  385. X          tlx = tly = 1;
  386. X+         curs(tlx, tly);
  387. X      }
  388. X      flags.toplin = 0;
  389. X  }
  390. X***************
  391. X*** 113,125 ****
  392. X      xmore("");
  393. X  }
  394. X  
  395. X  void
  396. X  cmore(s)
  397. X! register char *s;
  398. X  {
  399. X      xmore(s);
  400. X  }
  401. X  
  402. X  void
  403. X  clrlin(){
  404. X      if(flags.toplin) {
  405. X--- 139,157 ----
  406. X      xmore("");
  407. X  }
  408. X  
  409. X+ #endif /* OVL2 */
  410. X+ #ifdef OVLB
  411. X+ 
  412. X  void
  413. X  cmore(s)
  414. X! register const char *s;
  415. X  {
  416. X      xmore(s);
  417. X  }
  418. X  
  419. X+ #endif /* OVLB */
  420. X+ #ifdef OVL1
  421. X+ 
  422. X  void
  423. X  clrlin(){
  424. X      if(flags.toplin) {
  425. X***************
  426. X*** 134,143 ****
  427. X      flags.toplin = 0;
  428. X  }
  429. X  
  430. X! /*VARARGS1*/
  431. X! /* Note the modified mstatusline has 9 arguments KAA */
  432. X  
  433. X! /* Also note that these declarations rely on knowledge of the internals
  434. X   * of the variable argument handling stuff in "tradstdc.h"
  435. X   */
  436. X  
  437. X--- 166,176 ----
  438. X      flags.toplin = 0;
  439. X  }
  440. X  
  441. X! #endif /* OVL1 */
  442. X! #ifdef OVLB
  443. X  
  444. X! /*VARARGS1*/
  445. X! /* Note that these declarations rely on knowledge of the internals
  446. X   * of the variable argument handling stuff in "tradstdc.h"
  447. X   */
  448. X  
  449. X***************
  450. X*** 272,284 ****
  451. X  /*ARGSUSED*/
  452. X  /*VARARGS2*/
  453. X  void
  454. X! kludge  VA_DECL2(char *, str, char *, arg)
  455. X  #ifdef VA_NEXT
  456. X      char *other1, *other2, *other3;
  457. X  #endif
  458. X      VA_START(arg);
  459. X!     VA_INIT(str, char *);
  460. X!     VA_INIT(arg, char *);
  461. X  #ifdef VA_NEXT
  462. X      VA_NEXT(other1, char *);
  463. X      VA_NEXT(other2, char *);
  464. X--- 305,317 ----
  465. X  /*ARGSUSED*/
  466. X  /*VARARGS2*/
  467. X  void
  468. X! kludge  VA_DECL2(const char *, str, const char *, arg)
  469. X  #ifdef VA_NEXT
  470. X      char *other1, *other2, *other3;
  471. X  #endif
  472. X      VA_START(arg);
  473. X!     VA_INIT(str, const char *);
  474. X!     VA_INIT(arg, const char *);
  475. X  #ifdef VA_NEXT
  476. X      VA_NEXT(other1, char *);
  477. X      VA_NEXT(other2, char *);
  478. X***************
  479. X*** 294,299 ****
  480. X--- 327,335 ----
  481. X      VA_END();
  482. X  }
  483. X  
  484. X+ #endif /* OVLB */
  485. X+ #ifdef OVL0
  486. X+ 
  487. X  void
  488. X  putsym(c)
  489. X  char c;
  490. X***************
  491. X*** 325,330 ****
  492. X--- 361,369 ----
  493. X      while(*s) putsym(*s++);
  494. X  }
  495. X  
  496. X+ #endif /* OVL0 */
  497. X+ #ifdef OVL2
  498. X+ 
  499. X  char
  500. X  yn_function(resp, def)
  501. X  const char *resp;
  502. X***************
  503. X*** 356,367 ****
  504. X      return q;
  505. X  }
  506. X  
  507. X  /*VARARGS1*/
  508. X  void
  509. X! impossible VA_DECL(char *, s)
  510. X      VA_START(s);
  511. X!     VA_INIT(s, char *);
  512. X      vpline(s,VA_ARGS);
  513. X      pline("Program in disorder - perhaps you'd better Quit.");
  514. X      VA_END();
  515. X  }
  516. X--- 395,411 ----
  517. X      return q;
  518. X  }
  519. X  
  520. X+ #endif /* OVL2 */
  521. X+ #ifdef OVLB
  522. X+ 
  523. X  /*VARARGS1*/
  524. X  void
  525. X! impossible VA_DECL(const char *, s)
  526. X      VA_START(s);
  527. X!     VA_INIT(s, const char *);
  528. X      vpline(s,VA_ARGS);
  529. X      pline("Program in disorder - perhaps you'd better Quit.");
  530. X      VA_END();
  531. X  }
  532. X+ 
  533. X+ #endif /* OVLB */
  534. X*** src/Old/trap.c    Mon Feb 19 19:03:58 1990
  535. X--- src/trap.c    Mon Feb 19 10:17:41 1990
  536. X***************
  537. X*** 1,14 ****
  538. X! /*    SCCS Id: @(#)trap.c    3.0    89/11/10
  539. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  540. X  /* NetHack may be freely redistributed.  See license for details. */
  541. X  
  542. X  #include    "hack.h"
  543. X  #include    "edog.h"
  544. X- #include    "trapname.h"
  545. X  
  546. X! void domagictrap();
  547. X! static boolean thitm();
  548. X  
  549. X  /* Generic rust-armor function.  Returns TRUE if a message was printed;
  550. X   * "print", if set, means to print a message (and thus to return TRUE) even
  551. X   * if the item could not be rusted; otherwise a message is printed and TRUE is
  552. X--- 1,45 ----
  553. X! /*    SCCS Id: @(#)trap.c    3.0    89/11/20
  554. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  555. X  /* NetHack may be freely redistributed.  See license for details. */
  556. X  
  557. X  #include    "hack.h"
  558. X  #include    "edog.h"
  559. X  
  560. X! #ifdef OVLB
  561. X  
  562. X+ const char *traps[] = {
  563. X+     "",
  564. X+     " monster trap",
  565. X+     " statue trap",
  566. X+     " bear trap",
  567. X+     "n arrow trap",
  568. X+     " dart trap",
  569. X+     " trapdoor",
  570. X+     " teleportation trap",
  571. X+     " pit",
  572. X+     " sleeping gas trap"
  573. X+     ," magic trap"
  574. X+     ," squeaky board"
  575. X+     ," web"
  576. X+     ," spiked pit"
  577. X+     ," level teleporter"
  578. X+ #ifdef SPELLS
  579. X+     ,"n anti-magic field" 
  580. X+ #endif
  581. X+     ," rust trap"
  582. X+ #ifdef POLYSELF
  583. X+     ," polymorph trap"
  584. X+ #endif
  585. X+     ," land mine"
  586. X+ };
  587. X+ 
  588. X+ #endif /* OVLB */
  589. X+ 
  590. X+ void NDECL(domagictrap);
  591. X+ OSTATIC boolean FDECL(thitm, (int, struct monst *, struct obj *, int));
  592. X+ 
  593. X+ #ifdef OVLB
  594. X+ 
  595. X  /* Generic rust-armor function.  Returns TRUE if a message was printed;
  596. X   * "print", if set, means to print a message (and thus to return TRUE) even
  597. X   * if the item could not be rusted; otherwise a message is printed and TRUE is
  598. X***************
  599. X*** 17,28 ****
  600. X  boolean
  601. X  rust_dmg(otmp, ostr, type, print)
  602. X  register struct obj *otmp;
  603. X! register char *ostr;
  604. X  int type;
  605. X  boolean print;
  606. X  {
  607. X      static const char *gook[] = { "slag", "rust", "rot", "corrosion" };
  608. X      static const char *action[] = { "smolder", "rust", "rot", "corrode" };
  609. X      boolean vulnerable = FALSE;
  610. X      boolean plural;
  611. X  
  612. X--- 48,60 ----
  613. X  boolean
  614. X  rust_dmg(otmp, ostr, type, print)
  615. X  register struct obj *otmp;
  616. X! register const char *ostr;
  617. X  int type;
  618. X  boolean print;
  619. X  {
  620. X      static const char *gook[] = { "slag", "rust", "rot", "corrosion" };
  621. X      static const char *action[] = { "smolder", "rust", "rot", "corrode" };
  622. X+     static const char *msg[] =  { "burnt", "rusted", "rotten", "corroded" };
  623. X      boolean vulnerable = FALSE;
  624. X      boolean plural;
  625. X  
  626. X***************
  627. X*** 54,60 ****
  628. X              otmp->spe--;
  629. X              adj_abon(otmp, -1);
  630. X          }
  631. X!     } else Your("%s look%s quite rusted.", ostr, plural ? "" : "s");
  632. X      return(TRUE);
  633. X  }
  634. X  
  635. X--- 86,93 ----
  636. X              otmp->spe--;
  637. X              adj_abon(otmp, -1);
  638. X          }
  639. X!     } else Your("%s %s%s quite %s.", ostr, Blind ? "feel" : "look",
  640. X!                          plural ? "" : "s", msg[type]);
  641. X      return(TRUE);
  642. X  }
  643. X  
  644. X***************
  645. X*** 65,70 ****
  646. X--- 98,112 ----
  647. X      register struct trap *ttmp;
  648. X      register struct permonst *ptr;
  649. X  
  650. X+     if (ttmp = t_at(x,y)) {
  651. X+         if (u.utrap &&
  652. X+           ((u.utraptype == TT_BEARTRAP && typ != BEAR_TRAP) ||
  653. X+           (u.utraptype == TT_WEB && typ != WEB) ||
  654. X+           (u.utraptype == TT_PIT && typ != PIT && typ != SPIKED_PIT)))
  655. X+             u.utrap = 0;
  656. X+         ttmp->ttyp = typ;
  657. X+         return ttmp;
  658. X+     }
  659. X      ttmp = newtrap();
  660. X      ttmp->ttyp = typ;
  661. X      ttmp->tx = x;
  662. X***************
  663. X*** 71,81 ****
  664. X      ttmp->ty = y;
  665. X      switch(typ) {
  666. X          case MONST_TRAP:        /* create a monster in "hiding" */
  667. X          if(rn2(5) && (ptr = mkclass(S_PIERCER)))
  668. X              ttmp->pm = monsndx(ptr);
  669. X!         else
  670. X              ttmp->pm = rndmonnum();
  671. X          break;
  672. X          case STATUE_TRAP:        /* create a "living" statue */
  673. X          ttmp->pm = rndmonnum();
  674. X          (void) mkcorpstat(STATUE, &mons[ttmp->pm], x, y);
  675. X--- 113,131 ----
  676. X      ttmp->ty = y;
  677. X      switch(typ) {
  678. X          case MONST_TRAP:        /* create a monster in "hiding" */
  679. X+         {    int tryct = 0;
  680. X          if(rn2(5) && (ptr = mkclass(S_PIERCER)))
  681. X              ttmp->pm = monsndx(ptr);
  682. X!         else do {
  683. X              ttmp->pm = rndmonnum();
  684. X+         } while ((noattacks(&mons[ttmp->pm]) ||
  685. X+             !mons[ttmp->pm].mmove) && ++tryct < 100);
  686. X+         if (tryct == 100) {
  687. X+             free((genericptr_t)ttmp);
  688. X+             return(struct trap *)0;
  689. X+         }
  690. X          break;
  691. X+         }
  692. X          case STATUE_TRAP:        /* create a "living" statue */
  693. X          ttmp->pm = rndmonnum();
  694. X          (void) mkcorpstat(STATUE, &mons[ttmp->pm], x, y);
  695. X***************
  696. X*** 111,119 ****
  697. X  #ifdef POLYSELF
  698. X           || is_flyer(uasmon)
  699. X  #endif
  700. X!         )) &&
  701. X!            !(IS_DOOR(levl[x][y].typ) &&
  702. X!              (levl[x][y].doormask & (D_LOCKED | D_CLOSED)));
  703. X      return(tmp1 && tmp2 && tmp3);
  704. X  #else
  705. X      return( isok(x,y) &&
  706. X--- 161,167 ----
  707. X  #ifdef POLYSELF
  708. X           || is_flyer(uasmon)
  709. X  #endif
  710. X!         )) && !closed_door(x,y);
  711. X      return(tmp1 && tmp2 && tmp3);
  712. X  #else
  713. X      return( isok(x,y) &&
  714. X***************
  715. X*** 129,138 ****
  716. X  #ifdef POLYSELF
  717. X            || is_flyer(uasmon)
  718. X  #endif
  719. X!           )) &&
  720. X!         !(IS_DOOR(levl[x][y].typ) &&
  721. X!              (levl[x][y].doormask & (D_LOCKED | D_CLOSED)))
  722. X!     );
  723. X  #endif
  724. X      /* Note: gold is permitted (because of vaults) */
  725. X  }
  726. X--- 177,183 ----
  727. X  #ifdef POLYSELF
  728. X            || is_flyer(uasmon)
  729. X  #endif
  730. X!           )) && !closed_door(x,y));
  731. X  #endif
  732. X      /* Note: gold is permitted (because of vaults) */
  733. X  }
  734. X***************
  735. X*** 189,199 ****
  736. X          case BEAR_TRAP:
  737. X              if(Levitation
  738. X  #ifdef POLYSELF
  739. X!             || is_flyer(uasmon)
  740. X! #endif
  741. X!             ) {
  742. X              You("%s over a bear trap.",
  743. X                    Levitation ? "float" : "fly");
  744. X              break;
  745. X              }
  746. X  #ifdef POLYSELF
  747. X--- 234,246 ----
  748. X          case BEAR_TRAP:
  749. X              if(Levitation
  750. X  #ifdef POLYSELF
  751. X!                 || is_flyer(uasmon)) {
  752. X              You("%s over a bear trap.",
  753. X                    Levitation ? "float" : "fly");
  754. X+ #else
  755. X+                 ) {
  756. X+             You("float over a bear trap.");
  757. X+ #endif
  758. X              break;
  759. X              }
  760. X  #ifdef POLYSELF
  761. X***************
  762. X*** 253,266 ****
  763. X          case TRAPDOOR:
  764. X              if(is_maze_lev
  765. X  #ifdef STRONGHOLD
  766. X!               && (dlevel > stronghold_level)
  767. X! #endif /* STRONGHOLD /**/
  768. X                ) {
  769. X      pline("A trap door in the ceiling opens and a rock falls on your %s!",
  770. X                  body_part(HEAD));
  771. X              if(uarmh)
  772. X                  pline("Fortunately, you are wearing a helmet!");
  773. X!             losehp(uarmh ? 2 : d(2,10),"falling rock");
  774. X              (void) mksobj_at(ROCK, u.ux, u.uy);
  775. X              fobj->quan = 1;
  776. X              fobj->owt = weight(fobj);
  777. X--- 300,313 ----
  778. X          case TRAPDOOR:
  779. X              if(is_maze_lev
  780. X  #ifdef STRONGHOLD
  781. X!              && (dlevel > stronghold_level)
  782. X! #endif
  783. X                ) {
  784. X      pline("A trap door in the ceiling opens and a rock falls on your %s!",
  785. X                  body_part(HEAD));
  786. X              if(uarmh)
  787. X                  pline("Fortunately, you are wearing a helmet!");
  788. X!             losehp(uarmh ? 2 : d(2,10),"falling rock", KILLED_BY_AN);
  789. X              (void) mksobj_at(ROCK, u.ux, u.uy);
  790. X              fobj->quan = 1;
  791. X              fobj->owt = weight(fobj);
  792. X***************
  793. X*** 276,285 ****
  794. X              pline("A trap door opens up under you!");
  795. X              if(Levitation || u.ustuck || dlevel == MAXLEVEL
  796. X  #ifdef POLYSELF
  797. X!                     || is_flyer(uasmon)
  798. X  #endif
  799. X  #ifdef ENDGAME
  800. X!                     || dlevel == ENDLEVEL
  801. X  #endif
  802. X                              ) {
  803. X                  You("don't fall in.");
  804. X--- 323,332 ----
  805. X              pline("A trap door opens up under you!");
  806. X              if(Levitation || u.ustuck || dlevel == MAXLEVEL
  807. X  #ifdef POLYSELF
  808. X!                 || is_flyer(uasmon) || u.umonnum == PM_WUMPUS
  809. X  #endif
  810. X  #ifdef ENDGAME
  811. X!                 || dlevel == ENDLEVEL
  812. X  #endif
  813. X                              ) {
  814. X                  You("don't fall in.");
  815. X***************
  816. X*** 290,295 ****
  817. X--- 337,343 ----
  818. X                  You("are jerked back by your pet!");
  819. X              else {
  820. X  #endif
  821. X+                 if(in_shop(u.ux, u.uy)) shopdig(1);
  822. X                  unsee();
  823. X                  (void) fflush(stdout);
  824. X                  goto_level(newlevel, FALSE, TRUE);
  825. X***************
  826. X*** 301,307 ****
  827. X          case DART_TRAP:
  828. X              pline("A little dart shoots out at you!");
  829. X              if(thitu(7,rnd(3),(struct obj *)0,"little dart")) {
  830. X!             if(!rn2(6)) poisoned("dart",A_CON,"poison dart");
  831. X              } else {
  832. X              (void) mksobj_at(DART, u.ux, u.uy);
  833. X              fobj->quan = 1;
  834. X--- 349,355 ----
  835. X          case DART_TRAP:
  836. X              pline("A little dart shoots out at you!");
  837. X              if(thitu(7,rnd(3),(struct obj *)0,"little dart")) {
  838. X!             if(!rn2(6)) poisoned("dart",A_CON,"poison dart",10);
  839. X              } else {
  840. X              (void) mksobj_at(DART, u.ux, u.uy);
  841. X              fobj->quan = 1;
  842. X***************
  843. X*** 343,349 ****
  844. X              break;
  845. X          case RUST_TRAP:
  846. X  #ifdef POLYSELF
  847. X! #ifdef GOLEMS
  848. X              if (u.umonnum == PM_IRON_GOLEM) {
  849. X              pline("A gush of water hits you!");
  850. X              You("are covered with rust!");
  851. X--- 391,397 ----
  852. X              break;
  853. X          case RUST_TRAP:
  854. X  #ifdef POLYSELF
  855. X! # ifdef GOLEMS
  856. X              if (u.umonnum == PM_IRON_GOLEM) {
  857. X              pline("A gush of water hits you!");
  858. X              You("are covered with rust!");
  859. X***************
  860. X*** 350,356 ****
  861. X              rehumanize();
  862. X              break;
  863. X              } else
  864. X! #endif /* GOLEMS */
  865. X              if (u.umonnum == PM_GREMLIN && rn2(3)) {
  866. X              pline("A gush of water hits you!");
  867. X              if(mtmp = cloneu()) {
  868. X--- 398,404 ----
  869. X              rehumanize();
  870. X              break;
  871. X              } else
  872. X! # endif /* GOLEMS */
  873. X              if (u.umonnum == PM_GREMLIN && rn2(3)) {
  874. X              pline("A gush of water hits you!");
  875. X              if(mtmp = cloneu()) {
  876. X***************
  877. X*** 415,421 ****
  878. X  #endif
  879. X              u.utrap = rn1(6,2);
  880. X              u.utraptype = TT_PIT;
  881. X!             losehp(rnd(6),"fall into a pit");
  882. X              selftouch("Falling, you");
  883. X              break;
  884. X          case SPIKED_PIT:
  885. X--- 463,469 ----
  886. X  #endif
  887. X              u.utrap = rn1(6,2);
  888. X              u.utraptype = TT_PIT;
  889. X!             losehp(rnd(6),"fell into a pit", NO_KILLER_PREFIX);
  890. X              selftouch("Falling, you");
  891. X              break;
  892. X          case SPIKED_PIT:
  893. X***************
  894. X*** 435,453 ****
  895. X  #endif
  896. X              u.utrap = rn1(6,2);
  897. X              u.utraptype = TT_PIT;
  898. X!             losehp(rnd(10),"fall onto iron spikes");
  899. X!             if(!rn2(6)) poisoned("spikes",A_STR,"poison spikes");
  900. X              selftouch("Falling, you");
  901. X              break;
  902. X          case LEVEL_TELEP:
  903. X!         {   int oldl = dlevel;
  904. X  
  905. X!             pline("You have %s onto a level teleport trap!",
  906. X  #ifdef POLYSELF
  907. X!             is_flyer(uasmon) ? "flown" :
  908. X!             (Levitation || nolimbs(uasmon)) ? "moved" : "stepped");
  909. X  #else
  910. X!             Levitation ? "moved" : "stepped");
  911. X  #endif
  912. X              if(Antimagic) {
  913. X              pru();
  914. X--- 483,503 ----
  915. X  #endif
  916. X              u.utrap = rn1(6,2);
  917. X              u.utraptype = TT_PIT;
  918. X!             losehp(rnd(10),"fell into a pit of iron spikes",
  919. X!             NO_KILLER_PREFIX);
  920. X!             if(!rn2(6)) poisoned("spikes",A_STR,"fall onto poison spikes",8);
  921. X              selftouch("Falling, you");
  922. X              break;
  923. X          case LEVEL_TELEP:
  924. X! 
  925. X!             {    int oldl = dlevel;
  926. X  
  927. X!             You("%s onto a level teleport trap!",
  928. X!               Levitation ? "float" :
  929. X  #ifdef POLYSELF
  930. X!               locomotion(uasmon, "step"));
  931. X  #else
  932. X!               "step");
  933. X  #endif
  934. X              if(Antimagic) {
  935. X              pru();
  936. X***************
  937. X*** 502,508 ****
  938. X          case MGTRP:        /* A magic trap. */
  939. X              if (!rn2(30)) {
  940. X              You("are caught in a magical explosion!");
  941. X!             losehp(rnd(10), "magical explosion");
  942. X  #ifdef SPELLS
  943. X              Your("body absorbs some of the magical energy!");
  944. X              u.uen = (u.uenmax += 2);
  945. X--- 552,558 ----
  946. X          case MGTRP:        /* A magic trap. */
  947. X              if (!rn2(30)) {
  948. X              You("are caught in a magical explosion!");
  949. X!             losehp(rnd(10), "magical explosion", KILLED_BY_AN);
  950. X  #ifdef SPELLS
  951. X              Your("body absorbs some of the magical energy!");
  952. X              u.uen = (u.uenmax += 2);
  953. X***************
  954. X*** 515,521 ****
  955. X                          ) newsym(u.ux,u.uy);
  956. X              } else domagictrap();
  957. X              break;
  958. X!         case SQBRD:        /* Stepped on a squeaky board. */
  959. X              if (Levitation
  960. X  #ifdef POLYSELF
  961. X              || is_flyer(uasmon)
  962. X--- 565,571 ----
  963. X                          ) newsym(u.ux,u.uy);
  964. X              } else domagictrap();
  965. X              break;
  966. X!         case SQBRD:        /* stepped on a squeaky board */
  967. X              if (Levitation
  968. X  #ifdef POLYSELF
  969. X              || is_flyer(uasmon)
  970. X***************
  971. X*** 524,541 ****
  972. X              if (Hallucination) You("notice a crease in the linoleum.");
  973. X              else You("notice a loose board below you.");
  974. X              } else {
  975. X!             pline("A board underfoot gives off a loud squeak!");
  976. X              wake_nearby();
  977. X              }
  978. X              break;
  979. X          case WEB: /* Our luckless player has stumbled into a web. */
  980. X  
  981. X!             pline("You've %s into a spider web!",
  982. X!               Levitation ? "floated" :
  983. X  #ifdef POLYSELF
  984. X!               is_flyer(uasmon) ? "flown" :
  985. X  #endif
  986. X-               "stumbled");
  987. X              u.utraptype = TT_WEB;
  988. X  
  989. X              /* Time stuck in the web depends on your strength. */
  990. X--- 574,592 ----
  991. X              if (Hallucination) You("notice a crease in the linoleum.");
  992. X              else You("notice a loose board below you.");
  993. X              } else {
  994. X!             pline("A board beneath you squeaks loudly.");
  995. X              wake_nearby();
  996. X              }
  997. X              break;
  998. X          case WEB: /* Our luckless player has stumbled into a web. */
  999. X  
  1000. X!             You("%s into a spider web!",
  1001. X!               Levitation ? "float" :
  1002. X  #ifdef POLYSELF
  1003. X!               locomotion(uasmon, "stumble"));
  1004. X! #else
  1005. X!               "stumble");
  1006. X  #endif
  1007. X              u.utraptype = TT_WEB;
  1008. X  
  1009. X              /* Time stuck in the web depends on your strength. */
  1010. X***************
  1011. X*** 556,584 ****
  1012. X              break;
  1013. X  
  1014. X          case LANDMINE: {
  1015. X! #        ifndef LINT
  1016. X              register struct monst *mtmp = fmon;
  1017. X! #        endif /* LINT */
  1018. X  
  1019. X              if (Levitation
  1020. X  #ifdef POLYSELF
  1021. X!                         || is_flyer(uasmon)
  1022. X  #endif
  1023. X                                  ) {
  1024. X!             You("see a trigger in a pile of soil below you!");
  1025. X              if (rn2(3)) break;
  1026. X              pline("KAABLAMM!!!  The air currents set it off!");
  1027. X              } else {
  1028. X! #ifdef POLYSELF
  1029. X!             pline("KAABLAMM!!!  You %s a land mine!",
  1030. X!                 nolimbs(uasmon) ? "encountered" : "stepped on");
  1031. X! #else
  1032. X!             pline("KAABLAMM!!!  You stepped on a land mine!");
  1033. X! #endif
  1034. X              set_wounded_legs(LEFT_SIDE, 40 + rnd(35));
  1035. X              set_wounded_legs(RIGHT_SIDE, 40 + rnd(35));
  1036. X              }
  1037. X!             losehp(rnd(16), "land mine");
  1038. X              /* wake everything on the level */
  1039. X              while(mtmp) {
  1040. X              if(mtmp->msleep) mtmp->msleep = 0;
  1041. X--- 607,630 ----
  1042. X              break;
  1043. X  
  1044. X          case LANDMINE: {
  1045. X! #ifndef LINT
  1046. X              register struct monst *mtmp = fmon;
  1047. X! #endif
  1048. X  
  1049. X              if (Levitation
  1050. X  #ifdef POLYSELF
  1051. X!                     || is_flyer(uasmon)
  1052. X  #endif
  1053. X                                  ) {
  1054. X!             You("see a trigger in a pile of soil below you.");
  1055. X              if (rn2(3)) break;
  1056. X              pline("KAABLAMM!!!  The air currents set it off!");
  1057. X              } else {
  1058. X!             pline("KAABLAMM!!!  You triggered a land mine!");
  1059. X              set_wounded_legs(LEFT_SIDE, 40 + rnd(35));
  1060. X              set_wounded_legs(RIGHT_SIDE, 40 + rnd(35));
  1061. X              }
  1062. X!             losehp(rnd(16), "land mine", KILLED_BY_AN);
  1063. X              /* wake everything on the level */
  1064. X              while(mtmp) {
  1065. X              if(mtmp->msleep) mtmp->msleep = 0;
  1066. X***************
  1067. X*** 594,601 ****
  1068. X      }
  1069. X  }
  1070. X  
  1071. X  #ifdef WALKIES
  1072. X! static boolean
  1073. X  teleport_pet(mtmp)
  1074. X  register struct monst *mtmp;
  1075. X  {
  1076. X--- 640,654 ----
  1077. X      }
  1078. X  }
  1079. X  
  1080. X+ #endif /* OVLB */
  1081. X+ 
  1082. X  #ifdef WALKIES
  1083. X! 
  1084. X! OSTATIC boolean FDECL(teleport_pet, (struct monst *));
  1085. X! 
  1086. X! #ifdef OVLB
  1087. X! 
  1088. X! XSTATIC boolean
  1089. X  teleport_pet(mtmp)
  1090. X  register struct monst *mtmp;
  1091. X  {
  1092. X***************
  1093. X*** 618,625 ****
  1094. X--- 671,698 ----
  1095. X      }
  1096. X      return TRUE;
  1097. X  }
  1098. X+ 
  1099. X+ #endif /* OVLB */
  1100. X+ 
  1101. X  #endif
  1102. X  
  1103. X+ #ifdef OVLB
  1104. X+ 
  1105. X+ XSTATIC void
  1106. X+ seetrap(trap)
  1107. X+ 
  1108. X+     register struct trap *trap;
  1109. X+ {
  1110. X+     if(!trap->tseen) {
  1111. X+ 
  1112. X+         trap->tseen = 1;
  1113. X+         newsym(trap->tx, trap->ty);
  1114. X+     }
  1115. X+ }
  1116. X+ 
  1117. X+ #endif /* OVLB */
  1118. X+ #ifdef OVL1
  1119. X+ 
  1120. X  int
  1121. X  mintrap(mtmp)
  1122. X  register struct monst *mtmp;
  1123. X***************
  1124. X*** 651,660 ****
  1125. X              if(mtmp->data->msize > MZ_SMALL &&
  1126. X                 !amorphous(mtmp->data)) {
  1127. X                  mtmp->mtrapped = 1;
  1128. X!                 if(in_sight)
  1129. X                    pline("%s is caught in a bear trap!",
  1130. X                      Monnam(mtmp));
  1131. X!                 else
  1132. X                      if((mtmp->data == &mons[PM_OWLBEAR]
  1133. X                      || mtmp->data == &mons[PM_BUGBEAR])
  1134. X                      && flags.soundok)
  1135. X--- 724,734 ----
  1136. X              if(mtmp->data->msize > MZ_SMALL &&
  1137. X                 !amorphous(mtmp->data)) {
  1138. X                  mtmp->mtrapped = 1;
  1139. X!                 if(in_sight) {
  1140. X                    pline("%s is caught in a bear trap!",
  1141. X                      Monnam(mtmp));
  1142. X!                   seetrap(trap);
  1143. X!                 } else
  1144. X                      if((mtmp->data == &mons[PM_OWLBEAR]
  1145. X                      || mtmp->data == &mons[PM_BUGBEAR])
  1146. X                      && flags.soundok)
  1147. X***************
  1148. X*** 663,681 ****
  1149. X              break;
  1150. X  #ifdef POLYSELF
  1151. X          case POLY_TRAP:
  1152. X!             if(!resist(mtmp, WAND_SYM, 0, NOTELL))
  1153. X              (void) newcham(mtmp, (struct permonst *)0);
  1154. X              break;
  1155. X  #endif
  1156. X          case RUST_TRAP:
  1157. X              if(in_sight)
  1158. X!                 pline("A gush of water hits %s!", mon_nam(mtmp));
  1159. X  #ifdef GOLEMS
  1160. X              if (mtmp->data == &mons[PM_IRON_GOLEM]) {
  1161. X!                 if (in_sight) pline("%s falls to pieces!",
  1162. X!                                 Monnam(mtmp));
  1163. X                  else if(mtmp->mtame)
  1164. X!                      pline("May %s rust in peace.",
  1165. X                                  mon_nam(mtmp));
  1166. X                  mondied(mtmp);
  1167. X                  trapkilled = TRUE;
  1168. X--- 737,759 ----
  1169. X              break;
  1170. X  #ifdef POLYSELF
  1171. X          case POLY_TRAP:
  1172. X!             if(!resist(mtmp, WAND_SYM, 0, NOTELL)) {
  1173. X              (void) newcham(mtmp, (struct permonst *)0);
  1174. X+             seetrap(trap);
  1175. X+             }
  1176. X              break;
  1177. X  #endif
  1178. X          case RUST_TRAP:
  1179. X              if(in_sight)
  1180. X!                 pline("A gush of water hits %s!", mon_nam(mtmp));
  1181. X!             if(cansee(mtmp->mx,mtmp->my))
  1182. X!                 seetrap(trap);
  1183. X  #ifdef GOLEMS
  1184. X              if (mtmp->data == &mons[PM_IRON_GOLEM]) {
  1185. X!                 if (in_sight)
  1186. X!                     pline("%s falls to pieces!", Monnam(mtmp));
  1187. X                  else if(mtmp->mtame)
  1188. X!                     pline("May %s rust in peace.",
  1189. X                                  mon_nam(mtmp));
  1190. X                  mondied(mtmp);
  1191. X                  trapkilled = TRUE;
  1192. X***************
  1193. X*** 693,717 ****
  1194. X              break;
  1195. X          case PIT:
  1196. X          case SPIKED_PIT:
  1197. X!             /* there should be a mtmp/data -> floating */
  1198. X!             if(!is_flyer(mtmp->data) /* ab */
  1199. X!                && mtmp->data != &mons[PM_WUMPUS] /* 3. */) {
  1200. X                  if (!passes_walls(mtmp->data))
  1201. X!                   mtmp->mtrapped = 1;
  1202. X!                 if(in_sight)
  1203. X!                   pline("%s falls into a pit!", Monnam(mtmp));
  1204. X                  if(thitm(0, mtmp, (struct obj *)0,
  1205. X!                   rnd((tt==PIT) ? 6 : 10)))
  1206. X!                   trapkilled = TRUE;
  1207. X              }
  1208. X              break;
  1209. X          case SLP_GAS_TRAP:
  1210. X              if(!resists_sleep(mtmp->data) &&
  1211. X!                !mtmp->msleep && !mtmp->mfroz) {
  1212. X!                 mtmp->msleep = 1;
  1213. X                  if(in_sight)
  1214. X                    pline("%s suddenly falls asleep!",
  1215. X                      Monnam(mtmp));
  1216. X              }
  1217. X              break;
  1218. X          case TELEP_TRAP:
  1219. X--- 771,800 ----
  1220. X              break;
  1221. X          case PIT:
  1222. X          case SPIKED_PIT:
  1223. X!             /* TO DO: there should be a mtmp/data -> floating */
  1224. X!             if(!is_flyer(mtmp->data) &&
  1225. X!                mtmp->data != &mons[PM_WUMPUS]) {
  1226. X                  if (!passes_walls(mtmp->data))
  1227. X!                     mtmp->mtrapped = 1;
  1228. X!                 if(in_sight) {
  1229. X!                     pline("%s falls into a pit!", Monnam(mtmp));
  1230. X!                     seetrap(trap);
  1231. X!                 }
  1232. X                  if(thitm(0, mtmp, (struct obj *)0,
  1233. X!                      rnd((tt==PIT) ? 6 : 10)))
  1234. X!                     trapkilled = TRUE;
  1235. X              }
  1236. X              break;
  1237. X          case SLP_GAS_TRAP:
  1238. X              if(!resists_sleep(mtmp->data) &&
  1239. X!                !mtmp->msleep && mtmp->mcanmove) {
  1240. X!                 mtmp->mcanmove = 0;
  1241. X!                 mtmp->mfrozen = rnd(25);
  1242. X                  if(in_sight)
  1243. X                    pline("%s suddenly falls asleep!",
  1244. X                      Monnam(mtmp));
  1245. X+                 if(cansee(mtmp->mx,mtmp->my))
  1246. X+                     seetrap(trap);
  1247. X              }
  1248. X              break;
  1249. X          case TELEP_TRAP:
  1250. X***************
  1251. X*** 724,732 ****
  1252. X                   */
  1253. X                  if (trap->once) vloc(mtmp);
  1254. X                  else rloc(mtmp);
  1255. X!                 if(in_sight && !cansee(mtmp->mx,mtmp->my))
  1256. X                  pline("%s suddenly disappears!",
  1257. X                      Monnam(mtmp));
  1258. X  #ifdef WALKIES
  1259. X              }
  1260. X  #endif
  1261. X--- 807,817 ----
  1262. X                   */
  1263. X                  if (trap->once) vloc(mtmp);
  1264. X                  else rloc(mtmp);
  1265. X!                 if(in_sight && !cansee(mtmp->mx,mtmp->my)) {
  1266. X                  pline("%s suddenly disappears!",
  1267. X                      Monnam(mtmp));
  1268. X+                 seetrap(trap);
  1269. X+                 }
  1270. X  #ifdef WALKIES
  1271. X              }
  1272. X  #endif
  1273. X***************
  1274. X*** 735,740 ****
  1275. X--- 820,826 ----
  1276. X              otmp = mksobj(ARROW, FALSE);
  1277. X              otmp->quan = 1;
  1278. X              otmp->owt = weight(otmp);
  1279. X+             if(in_sight) seetrap(trap);
  1280. X              if(thitm(8, mtmp, otmp, 0)) trapkilled = TRUE;
  1281. X              break;
  1282. X          case DART_TRAP:
  1283. X***************
  1284. X*** 742,747 ****
  1285. X--- 828,834 ----
  1286. X              otmp->quan = 1;
  1287. X              if (!rn2(6)) otmp->opoisoned = 1;
  1288. X              otmp->owt = weight(otmp);
  1289. X+             if(in_sight) seetrap(trap);
  1290. X              if(thitm(7, mtmp, otmp, 0)) trapkilled = TRUE;
  1291. X              break;
  1292. X          case TRAPDOOR:
  1293. X***************
  1294. X*** 753,762 ****
  1295. X--- 840,851 ----
  1296. X                  otmp = mksobj(ROCK, FALSE);
  1297. X                  otmp->quan = 1;
  1298. X                  otmp->owt = weight(otmp);
  1299. X+                 if(in_sight) seetrap(trap);
  1300. X                  if(thitm(0, mtmp, otmp, d(2, 10)))
  1301. X                      trapkilled = TRUE;
  1302. X                  break;
  1303. X              }
  1304. X+             if (mtmp->data == &mons[PM_WUMPUS]) break;
  1305. X              tdoor = TRUE;
  1306. X              /* Fall through */
  1307. X          case LEVEL_TELEP:
  1308. X***************
  1309. X*** 765,771 ****
  1310. X                  && !mtmp->wormno
  1311. X                  /* long worms with tails mustn't change levels */
  1312. X  #endif
  1313. X!                 ){
  1314. X  #ifdef WALKIES
  1315. X                  if(teleport_pet(mtmp)) {
  1316. X  #endif
  1317. X--- 854,860 ----
  1318. X                  && !mtmp->wormno
  1319. X                  /* long worms with tails mustn't change levels */
  1320. X  #endif
  1321. X!                 ) {
  1322. X  #ifdef WALKIES
  1323. X                  if(teleport_pet(mtmp)) {
  1324. X  #endif
  1325. X***************
  1326. X*** 786,793 ****
  1327. X                      }
  1328. X                      fall_down(mtmp, newlev);
  1329. X                  }
  1330. X!                 if(in_sight)
  1331. X          pline("Suddenly, %s disappears out of sight.", mon_nam(mtmp));
  1332. X                  return(2);    /* no longer on this level */
  1333. X  #ifdef WALKIES
  1334. X                  }
  1335. X--- 875,884 ----
  1336. X                      }
  1337. X                      fall_down(mtmp, newlev);
  1338. X                  }
  1339. X!                 if(in_sight) {
  1340. X          pline("Suddenly, %s disappears out of sight.", mon_nam(mtmp));
  1341. X+                     seetrap(trap);
  1342. X+                 }
  1343. X                  return(2);    /* no longer on this level */
  1344. X  #ifdef WALKIES
  1345. X                  }
  1346. X***************
  1347. X*** 804,834 ****
  1348. X              register struct monst *ztmp = fmon;
  1349. X  
  1350. X              if(is_flyer(mtmp->data)) break;
  1351. X!             /* Stepped on a squeaky board. */
  1352. X!             if (in_sight)
  1353. X!                pline("%s steps on a squeaky board.", Monnam(mtmp));
  1354. X!             else
  1355. X                 You("hear a distant squeak.");
  1356. X!             /* Wake up nearby monsters. */
  1357. X!                while(ztmp) {
  1358. X!              if(dist2(mtmp->mx,mtmp->my,ztmp->mx,ztmp->my) < 40)
  1359. X!                    if(ztmp->msleep) ztmp->msleep = 0;
  1360. X!              ztmp = ztmp->nmon;
  1361. X!                }
  1362. X              break;
  1363. X          }
  1364. X             case WEB:
  1365. X!                /* Monster in a web. */
  1366. X!             /* in_sight check and confused bear by Eric Backus */
  1367. X!                if(mtmp->data->mlet != S_SPIDER) {
  1368. X!              if(in_sight)
  1369. X!                 pline("%s is caught in a web!", Monnam(mtmp));
  1370. X!               else
  1371. X!                 if(mtmp->data == &mons[PM_OWLBEAR])
  1372. X!                   You("hear the roaring of a confused bear!");
  1373. X!              mtmp->mtrapped = 1;
  1374. X!                }
  1375. X!               break;
  1376. X  #ifdef SPELLS
  1377. X          case ANTI_MAGIC:    break;
  1378. X  #endif
  1379. X--- 895,926 ----
  1380. X              register struct monst *ztmp = fmon;
  1381. X  
  1382. X              if(is_flyer(mtmp->data)) break;
  1383. X!             /* stepped on a squeaky board */
  1384. X!             if (in_sight) {
  1385. X!                 pline("A board beneath %s squeaks loudly.", mon_nam(mtmp));
  1386. X!                 seetrap(trap);
  1387. X!             } else
  1388. X                 You("hear a distant squeak.");
  1389. X!             /* wake up nearby monsters */
  1390. X!             while(ztmp) {
  1391. X!                 if(dist2(mtmp->mx,mtmp->my,ztmp->mx,ztmp->my) < 40)
  1392. X!                 if(ztmp->msleep) ztmp->msleep = 0;
  1393. X!                 ztmp = ztmp->nmon;
  1394. X!             }
  1395. X              break;
  1396. X          }
  1397. X             case WEB:
  1398. X!             /* Monster in a web. */
  1399. X!             if(mtmp->data->mlet != S_SPIDER) {
  1400. X!                 if(in_sight)
  1401. X!                 pline("%s is caught in a web.", Monnam(mtmp));
  1402. X!                 else /* Eric Backus */
  1403. X!                 if(mtmp->data == &mons[PM_OWLBEAR] ||
  1404. X!                     mtmp->data == &mons[PM_BUGBEAR])
  1405. X!                     You("hear the roaring of a confused bear!");
  1406. X!                 mtmp->mtrapped = 1;
  1407. X!             }
  1408. X!             break;
  1409. X  #ifdef SPELLS
  1410. X          case ANTI_MAGIC:    break;
  1411. X  #endif
  1412. X***************
  1413. X*** 838,845 ****
  1414. X              if(rn2(3))
  1415. X                  break; /* monsters usually don't set it off */
  1416. X              if(in_sight)
  1417. X!                 pline("KAABLAMM!!!  %s steps on a land mine!",
  1418. X!                       Monnam(mtmp));
  1419. X              else if (flags.soundok)
  1420. X                  pline("Kaablamm!  You hear an explosion in the distance!");
  1421. X              deltrap(t_at(mtmp->mx, mtmp->my));
  1422. X--- 930,937 ----
  1423. X              if(rn2(3))
  1424. X                  break; /* monsters usually don't set it off */
  1425. X              if(in_sight)
  1426. X!                 pline("KAABLAMM!!!  %s triggers a land mine!",
  1427. X!                   Monnam(mtmp));
  1428. X              else if (flags.soundok)
  1429. X                  pline("Kaablamm!  You hear an explosion in the distance!");
  1430. X              deltrap(t_at(mtmp->mx, mtmp->my));
  1431. X***************
  1432. X*** 854,860 ****
  1433. X              break;
  1434. X          }
  1435. X          default:
  1436. X!             impossible("Some monster encountered a strange trap of type %d.",tt);
  1437. X          }
  1438. X      }
  1439. X      if(trapkilled) return 2;
  1440. X--- 946,952 ----
  1441. X              break;
  1442. X          }
  1443. X          default:
  1444. X!             impossible("Some monster encountered a strange trap of type %d.", tt);
  1445. X          }
  1446. X      }
  1447. X      if(trapkilled) return 2;
  1448. X***************
  1449. X*** 861,869 ****
  1450. X      else return mtmp->mtrapped;
  1451. X  }
  1452. X  
  1453. X  void
  1454. X  selftouch(arg)
  1455. X! char *arg;
  1456. X  {
  1457. X      if(uwep && (uwep->otyp == CORPSE && uwep->corpsenm == PM_COCKATRICE)
  1458. X  #ifdef POLYSELF
  1459. X--- 953,964 ----
  1460. X      else return mtmp->mtrapped;
  1461. X  }
  1462. X  
  1463. X+ #endif /* OVL1 */
  1464. X+ #ifdef OVLB
  1465. X+ 
  1466. X  void
  1467. X  selftouch(arg)
  1468. X! const char *arg;
  1469. X  {
  1470. X      if(uwep && (uwep->otyp == CORPSE && uwep->corpsenm == PM_COCKATRICE)
  1471. X  #ifdef POLYSELF
  1472. X***************
  1473. X*** 872,878 ****
  1474. X      ){
  1475. X          pline("%s touch the cockatrice corpse.", arg);
  1476. X          You("turn to stone...");
  1477. X!         killer = "cockatrice corpse accident";
  1478. X          done(STONING);
  1479. X      }
  1480. X  }
  1481. X--- 967,974 ----
  1482. X      ){
  1483. X          pline("%s touch the cockatrice corpse.", arg);
  1484. X          You("turn to stone...");
  1485. X!         killer_format = KILLED_BY;
  1486. X!         killer = "touching a cockatrice corpse";
  1487. X          done(STONING);
  1488. X      }
  1489. X  }
  1490. X***************
  1491. X*** 988,993 ****
  1492. X--- 1084,1091 ----
  1493. X      unsee();
  1494. X      u.utrap = 0;
  1495. X      u.ustuck = 0;
  1496. X+     u.ux0 = u.ux;
  1497. X+     u.uy0 = u.uy;
  1498. X      u.ux = nux;
  1499. X      u.uy = nuy;
  1500. X  #ifdef POLYSELF
  1501. X***************
  1502. X*** 1013,1019 ****
  1503. X--- 1111,1121 ----
  1504. X      struct trap *trap;
  1505. X  #ifdef SPELLS
  1506. X      boolean castit = FALSE;
  1507. X+ # ifdef __GNULINT__
  1508. X+     register int sp_no = 0;
  1509. X+ # else
  1510. X      register int sp_no;
  1511. X+ # endif
  1512. X  #endif
  1513. X  
  1514. X      trap = t_at(u.ux, u.uy);
  1515. X***************
  1516. X*** 1034,1040 ****
  1517. X          if (trap)
  1518. X  #ifdef POLYSELF
  1519. X              You("%s onto the teleportation trap.",
  1520. X!                 nolimbs(uasmon) ? "slither" : "jump");
  1521. X  #else
  1522. X              You("jump onto the teleportation trap.");
  1523. X  #endif
  1524. X--- 1136,1142 ----
  1525. X          if (trap)
  1526. X  #ifdef POLYSELF
  1527. X              You("%s onto the teleportation trap.",
  1528. X!                 locomotion(uasmon, "jump"));
  1529. X  #else
  1530. X              You("jump onto the teleportation trap.");
  1531. X  #endif
  1532. X***************
  1533. X*** 1188,1195 ****
  1534. X  #endif
  1535. X          if(newlevel <= -10) {
  1536. X              You("arrive in heaven.");
  1537. X!             pline("\"You are here a bit early, but we'll let you in.\"");
  1538. X!             killer = "visit to heaven";
  1539. X              done(DIED);
  1540. X          } else    if (newlevel == -9) {
  1541. X              You("feel deliriously happy. ");
  1542. X--- 1290,1298 ----
  1543. X  #endif
  1544. X          if(newlevel <= -10) {
  1545. X              You("arrive in heaven.");
  1546. X!             verbalize("Thou art early, but we'll admit thee.");
  1547. X!             killer_format = NO_KILLER_PREFIX;
  1548. X!             killer = "went to heaven prematurely";
  1549. X              done(DIED);
  1550. X          } else    if (newlevel == -9) {
  1551. X              You("feel deliriously happy. ");
  1552. X***************
  1553. X*** 1219,1225 ****
  1554. X          pline("Unfortunately, you don't know how to fly.");
  1555. X          You("plummet a few thousand feet to your death.");
  1556. X          dlevel = 0;
  1557. X!         killer = "long fall";
  1558. X          done(DIED);
  1559. X  #ifdef WIZARD
  1560. X          return;  
  1561. X--- 1322,1330 ----
  1562. X          pline("Unfortunately, you don't know how to fly.");
  1563. X          You("plummet a few thousand feet to your death.");
  1564. X          dlevel = 0;
  1565. X!         killer_format = NO_KILLER_PREFIX;
  1566. X!         killer =
  1567. X!     self_pronoun("teleported out of the dungeon and fell to %s death","his");
  1568. X          done(DIED);
  1569. X  #ifdef WIZARD
  1570. X          return;  
  1571. X***************
  1572. X*** 1284,1303 ****
  1573. X              } else {
  1574. X                  num = rnd(6);
  1575. X                  u.uhpmax -= num;
  1576. X!                 losehp(num,"burst of flame");
  1577. X                  break;
  1578. X              }
  1579. X                }
  1580. X  
  1581. X           /* odd feelings */
  1582. X!          case 13:   pline("A shiver runs up and down your spine!");
  1583. X!              /* TO DO: What if you're polymorphed into something spineless? */
  1584. X              break;
  1585. X           case 14:    You(Hallucination ?
  1586. X                  "hear the moon howling at you." :
  1587. X                  "hear distant howling.");
  1588. X              break;
  1589. X!          case 15:   You("suddenly yearn for your distant homeland.");
  1590. X              break;
  1591. X           case 16:   Your("pack shakes violently!");
  1592. X              break;
  1593. X--- 1389,1410 ----
  1594. X              } else {
  1595. X                  num = rnd(6);
  1596. X                  u.uhpmax -= num;
  1597. X!                 losehp(num,"burst of flame", KILLED_BY_AN);
  1598. X                  break;
  1599. X              }
  1600. X                }
  1601. X  
  1602. X           /* odd feelings */
  1603. X!          case 13:    pline("A shiver runs up and down your %s!",
  1604. X!                   body_part(SPINE));
  1605. X              break;
  1606. X           case 14:    You(Hallucination ?
  1607. X                  "hear the moon howling at you." :
  1608. X                  "hear distant howling.");
  1609. X              break;
  1610. X!          case 15:    You("suddenly yearn for %s.",
  1611. X!                 Hallucination ? "Cleveland" :
  1612. X!                         "your distant homeland");
  1613. X              break;
  1614. X           case 16:   Your("pack shakes violently!");
  1615. X              break;
  1616. X***************
  1617. X*** 1344,1356 ****
  1618. X  
  1619. X      /* Scrolls and potions get affected by the water */
  1620. X      for(obj = invent; obj; obj = obj->nobj) {
  1621. X!         if(obj->olet == SCROLL_SYM && rn2(12) > u.uluck
  1622. X  #ifdef MAIL
  1623. X              && obj->otyp != SCR_MAIL
  1624. X  #endif
  1625. X                                  )
  1626. X              obj->otyp = SCR_BLANK_PAPER;
  1627. X!         if(obj->olet == POTION_SYM && rn2(12) > u.uluck) {
  1628. X              if (obj->spe == -1) {
  1629. X                  obj->otyp = POT_WATER;
  1630. X                  obj->blessed = obj->cursed = 0;
  1631. X--- 1451,1463 ----
  1632. X  
  1633. X      /* Scrolls and potions get affected by the water */
  1634. X      for(obj = invent; obj; obj = obj->nobj) {
  1635. X!         if(obj->olet == SCROLL_SYM && rn2(12) > Luck
  1636. X  #ifdef MAIL
  1637. X              && obj->otyp != SCR_MAIL
  1638. X  #endif
  1639. X                                  )
  1640. X              obj->otyp = SCR_BLANK_PAPER;
  1641. X!         if(obj->olet == POTION_SYM && rn2(12) > Luck) {
  1642. X              if (obj->spe == -1) {
  1643. X                  obj->otyp = POT_WATER;
  1644. X                  obj->blessed = obj->cursed = 0;
  1645. X***************
  1646. X*** 1378,1389 ****
  1647. X  #ifdef WIZARD
  1648. X      wizard ||
  1649. X  #endif
  1650. X!     rn2(3) < u.uluck+2) {
  1651. X          You("attempt a teleport spell.");    /* utcsri!carroll */
  1652. X          (void) dotele();
  1653. X          if(!is_pool(u.ux,u.uy)) return;
  1654. X      }
  1655. X      You("drown.");
  1656. X      killer = levl[u.ux][u.uy].typ == POOL ? "pool of water" : "moat";
  1657. X      done(DROWNING);
  1658. X  }
  1659. X--- 1485,1497 ----
  1660. X  #ifdef WIZARD
  1661. X      wizard ||
  1662. X  #endif
  1663. X!     rn2(3) < Luck+2) {
  1664. X          You("attempt a teleport spell.");    /* utcsri!carroll */
  1665. X          (void) dotele();
  1666. X          if(!is_pool(u.ux,u.uy)) return;
  1667. X      }
  1668. X      You("drown.");
  1669. X+     killer_format = KILLED_BY_AN;
  1670. X      killer = levl[u.ux][u.uy].typ == POOL ? "pool of water" : "moat";
  1671. X      done(DROWNING);
  1672. X  }
  1673. X***************
  1674. X*** 1519,1528 ****
  1675. X      register struct obj *otmp,*otmp2;
  1676. X      char    buf[80];
  1677. X  
  1678. X!     if(rn2(13+u.uluck) > 7) return;
  1679. X  
  1680. X      otmp = obj;
  1681. X!     switch(rn2(13-u.uluck)) {    /* which trap? */
  1682. X          case 23:
  1683. X          case 22:
  1684. X          case 21:
  1685. X--- 1627,1638 ----
  1686. X      register struct obj *otmp,*otmp2;
  1687. X      char    buf[80];
  1688. X  
  1689. X!     if(Luck > -13 && rn2(13+Luck) > 7) return;
  1690. X  
  1691. X      otmp = obj;
  1692. X!     switch(rn2(20) ? ((Luck >= 13) ? 0 : rn2(13-Luck)) : rn2(26)) {
  1693. X!         case 25:
  1694. X!         case 24:
  1695. X          case 23:
  1696. X          case 22:
  1697. X          case 21:
  1698. X***************
  1699. X*** 1536,1542 ****
  1700. X                  delobj(otmp);
  1701. X              }
  1702. X  
  1703. X!             losehp(d(6,6), buf);
  1704. X              wake_nearby();
  1705. X              return;
  1706. X          case 20:
  1707. X--- 1646,1652 ----
  1708. X                  delobj(otmp);
  1709. X              }
  1710. X  
  1711. X!             losehp(d(6,6), buf, KILLED_BY_AN);
  1712. X              wake_nearby();
  1713. X              return;
  1714. X          case 20:
  1715. X***************
  1716. X*** 1545,1562 ****
  1717. X          case 17:
  1718. X              pline("A cloud of noxious gas billows from the %s.",
  1719. X                    xname(obj));
  1720. X!             poisoned("gas cloud", A_STR, "cloud of poison gas");
  1721. X              break;
  1722. X          case 16:
  1723. X          case 15:
  1724. X          case 14:
  1725. X          case 13:
  1726. X              pline("A tower of flame erupts from the %s",
  1727. X                    xname(obj));
  1728. X              if(Fire_resistance) {
  1729. X                  shieldeff(u.ux, u.uy);
  1730. X                  You("don't seem to be affected.");
  1731. X!             } else    losehp(d(4, 6), "tower of flame");
  1732. X              destroy_item(SCROLL_SYM, AD_FIRE);
  1733. X  #ifdef SPELLS
  1734. X              destroy_item(SPBOOK_SYM, AD_FIRE);
  1735. X--- 1655,1679 ----
  1736. X          case 17:
  1737. X              pline("A cloud of noxious gas billows from the %s.",
  1738. X                    xname(obj));
  1739. X!             poisoned("gas cloud", A_STR, "cloud of poison gas",15);
  1740. X              break;
  1741. X          case 16:
  1742. X          case 15:
  1743. X          case 14:
  1744. X          case 13:
  1745. X+             You("feel a needle prick your %s.",body_part(bodypart));
  1746. X+             poisoned("needle", A_CON, "poison needle",10);
  1747. X+             break;
  1748. X+         case 12:
  1749. X+         case 11:
  1750. X+         case 10:
  1751. X+         case 9:
  1752. X              pline("A tower of flame erupts from the %s",
  1753. X                    xname(obj));
  1754. X              if(Fire_resistance) {
  1755. X                  shieldeff(u.ux, u.uy);
  1756. X                  You("don't seem to be affected.");
  1757. X!             } else    losehp(d(4, 6), "tower of flame", KILLED_BY_AN);
  1758. X              destroy_item(SCROLL_SYM, AD_FIRE);
  1759. X  #ifdef SPELLS
  1760. X              destroy_item(SPBOOK_SYM, AD_FIRE);
  1761. X***************
  1762. X*** 1563,1589 ****
  1763. X  #endif
  1764. X              destroy_item(POTION_SYM, AD_FIRE);
  1765. X              break;
  1766. X!         case 12:
  1767. X!         case 10:
  1768. X!         case 9:
  1769. X              You("are jolted by a surge of electricity!");
  1770. X              if(Shock_resistance)  {
  1771. X                  shieldeff(u.ux, u.uy);
  1772. X                  You("don't seem to be affected.");
  1773. X!             } else    losehp(d(4, 4), "electric shock");
  1774. X              destroy_item(RING_SYM, AD_ELEC);
  1775. X              destroy_item(WAND_SYM, AD_ELEC);
  1776. X              break;
  1777. X!         case 8:
  1778. X!         case 7:
  1779. X!         case 6:
  1780. X              pline("Suddenly you are frozen in place!");
  1781. X              nomovemsg = "You can move again.";
  1782. X              multi = -d(5, 6);
  1783. X              break;
  1784. X!         case 5:
  1785. X!         case 4:
  1786. X!         case 3:
  1787. X              pline("A cloud of %s gas billows from the %s",
  1788. X                    hcolor(), xname(obj));
  1789. X              if(!Stunned)
  1790. X--- 1680,1706 ----
  1791. X  #endif
  1792. X              destroy_item(POTION_SYM, AD_FIRE);
  1793. X              break;
  1794. X!         case 8:
  1795. X!         case 7:
  1796. X!         case 6:
  1797. X              You("are jolted by a surge of electricity!");
  1798. X              if(Shock_resistance)  {
  1799. X                  shieldeff(u.ux, u.uy);
  1800. X                  You("don't seem to be affected.");
  1801. X!             } else    losehp(d(4, 4), "electric shock", KILLED_BY_AN);
  1802. X              destroy_item(RING_SYM, AD_ELEC);
  1803. X              destroy_item(WAND_SYM, AD_ELEC);
  1804. X              break;
  1805. X!         case 5:
  1806. X!         case 4:
  1807. X!         case 3:
  1808. X              pline("Suddenly you are frozen in place!");
  1809. X              nomovemsg = "You can move again.";
  1810. X              multi = -d(5, 6);
  1811. X              break;
  1812. X!         case 2:
  1813. X!         case 1:
  1814. X!         case 0:
  1815. X              pline("A cloud of %s gas billows from the %s",
  1816. X                    hcolor(), xname(obj));
  1817. X              if(!Stunned)
  1818. X***************
  1819. X*** 1594,1607 ****
  1820. X              make_stunned(HStun + rn1(7, 16),FALSE);
  1821. X              make_hallucinated(Hallucination + rn1(5, 16),FALSE);
  1822. X              break;
  1823. X!         default:
  1824. X!             You("feel a needle prick your %s.",body_part(bodypart));
  1825. X!             poisoned("needle", A_CON, "a poisoned needle");
  1826. X              break;
  1827. X      }
  1828. X      otmp->otrapped = 0;        /* these traps are one-shot things */
  1829. X  }
  1830. X  
  1831. X  void
  1832. X  wake_nearby() {            /* Wake up nearby monsters. */
  1833. X      register struct monst *mtmp;
  1834. X--- 1711,1726 ----
  1835. X              make_stunned(HStun + rn1(7, 16),FALSE);
  1836. X              make_hallucinated(Hallucination + rn1(5, 16),FALSE);
  1837. X              break;
  1838. X!         default: impossible("bad chest trap");
  1839. X              break;
  1840. X      }
  1841. X+     bot();             /* to get immediate botl re-display */
  1842. X      otmp->otrapped = 0;        /* these traps are one-shot things */
  1843. X  }
  1844. X  
  1845. X+ #endif /* OVLB */
  1846. X+ #ifdef OVL2
  1847. X+ 
  1848. X  void
  1849. X  wake_nearby() {            /* Wake up nearby monsters. */
  1850. X      register struct monst *mtmp;
  1851. X***************
  1852. X*** 1614,1619 ****
  1853. X--- 1733,1741 ----
  1854. X      }
  1855. X  }
  1856. X  
  1857. X+ #endif /* OVL2 */
  1858. X+ #ifdef OVL0
  1859. X+ 
  1860. X  struct trap *
  1861. X  t_at(x,y)
  1862. X  register int x, y;
  1863. X***************
  1864. X*** 1626,1631 ****
  1865. X--- 1748,1756 ----
  1866. X      return((struct trap *)0);
  1867. X  }
  1868. X  
  1869. X+ #endif /* OVL0 */
  1870. X+ #ifdef OVLB
  1871. X+ 
  1872. X  void
  1873. X  deltrap(trap)
  1874. X  register struct trap *trap;
  1875. X***************
  1876. X*** 1643,1662 ****
  1877. X  
  1878. X  void
  1879. X  b_trapped(item)        /* used for doors. can be used */
  1880. X! register char *item;    /* for anything else that opens */
  1881. X  {
  1882. X      register int dmg = rnd(5+(dlevel < 5 ? dlevel : 2+dlevel/2));
  1883. X  
  1884. X      pline("KABOOM!!  The %s was booby-trapped!", item);
  1885. X!     if(u.ulevel < 4 && dlevel < 3 && !rn2(3)) 
  1886. X          You("are shaken, but luckily unhurt.");        
  1887. X!     else losehp(dmg, "explosion");
  1888. X      make_stunned(HStun + dmg, TRUE);
  1889. X  }
  1890. X  
  1891. X  /* Monster is hit by trap. */
  1892. X  /* Note: doesn't work if both obj and d_override are null */
  1893. X! static boolean
  1894. X  thitm(tlev, mon, obj, d_override)
  1895. X  register int tlev;
  1896. X  register struct monst *mon;
  1897. X--- 1768,1787 ----
  1898. X  
  1899. X  void
  1900. X  b_trapped(item)        /* used for doors. can be used */
  1901. X! register const char *item;    /* for anything else that opens */
  1902. X  {
  1903. X      register int dmg = rnd(5+(dlevel < 5 ? dlevel : 2+dlevel/2));
  1904. X  
  1905. X      pline("KABOOM!!  The %s was booby-trapped!", item);
  1906. X!     if(u.ulevel < 4 && dlevel < 3 && !rnl(3))
  1907. X          You("are shaken, but luckily unhurt.");        
  1908. X!     else losehp(dmg, "explosion", KILLED_BY_AN);
  1909. X      make_stunned(HStun + dmg, TRUE);
  1910. X  }
  1911. X  
  1912. X  /* Monster is hit by trap. */
  1913. X  /* Note: doesn't work if both obj and d_override are null */
  1914. X! XSTATIC boolean
  1915. X  thitm(tlev, mon, obj, d_override)
  1916. X  register int tlev;
  1917. X  register struct monst *mon;
  1918. X***************
  1919. X*** 1719,1721 ****
  1920. X--- 1844,1848 ----
  1921. X          !strncmp(nomovemsg,"You regain con", 15) ||
  1922. X          !strncmp(nomovemsg,"You are consci", 15)));
  1923. X  }
  1924. X+ 
  1925. X+ #endif /* OVLB */
  1926. X*** others/Old/pcunix.c    Mon Feb 19 23:35:44 1990
  1927. X--- others/pcunix.c    Mon Feb  5 18:45:43 1990
  1928. X***************
  1929. X*** 1,4 ****
  1930. X! /*    SCCS Id: @(#)pcunix.c    3.0    88/07/21
  1931. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1932. X  /* NetHack may be freely redistributed.  See license for details. */
  1933. X  
  1934. X--- 1,4 ----
  1935. X! /*    SCCS Id: @(#)pcunix.c    3.0    89/12/29
  1936. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1937. X  /* NetHack may be freely redistributed.  See license for details. */
  1938. X  
  1939. X***************
  1940. X*** 14,26 ****
  1941. X   */
  1942. X  
  1943. X  #include "hack.h"    /* mainly for index() which depends on BSD */
  1944. X- #ifdef TOS
  1945. X- #ifndef OLD_TOS
  1946. X- #include <errno.h>
  1947. X- #else
  1948. X- #include <error.h>
  1949. X- #endif /* OLD_TOS */
  1950. X- #endif
  1951. X  
  1952. X  #ifndef MACOS
  1953. X  #include    <sys/types.h>
  1954. X--- 14,19 ----
  1955. X***************
  1956. X*** 27,36 ****
  1957. X  #include    <sys/stat.h>
  1958. X  #endif
  1959. X  
  1960. X! #ifndef OLD_TOS
  1961. X! # ifndef MACOS
  1962. X! static struct stat buf, hbuf;
  1963. X  # endif
  1964. X  
  1965. X  void
  1966. X  setrandom()
  1967. X--- 20,33 ----
  1968. X  #include    <sys/stat.h>
  1969. X  #endif
  1970. X  
  1971. X! #ifdef OVLB
  1972. X! 
  1973. X! #ifndef MACOS
  1974. X! static struct stat buf;
  1975. X! # ifdef WANT_GETHDATE
  1976. X! static struct stat hbuf;
  1977. X  # endif
  1978. X+ #endif
  1979. X  
  1980. X  void
  1981. X  setrandom()
  1982. X***************
  1983. X*** 96,107 ****
  1984. X      return(getlt()->tm_hour == 0);
  1985. X  }
  1986. X  
  1987. X! # ifndef MACOS
  1988. X  void
  1989. X  gethdate(name)
  1990. X  char *name;
  1991. X  {
  1992. X! #  if defined(TOS) && !defined(__GNUC__)
  1993. X  /* old version - for people short of space */
  1994. X  /*
  1995. X  /* register char *np;
  1996. X--- 93,104 ----
  1997. X      return(getlt()->tm_hour == 0);
  1998. X  }
  1999. X  
  2000. X! #ifndef MACOS
  2001. X  void
  2002. X  gethdate(name)
  2003. X  char *name;
  2004. X  {
  2005. X! # ifdef WANT_GETHDATE
  2006. X  /* old version - for people short of space */
  2007. X  /*
  2008. X  /* register char *np;
  2009. X***************
  2010. X*** 141,152 ****
  2011. X      path = np + 1;
  2012. X      }
  2013. X      error("Cannot get status of %s.", (np = rindex(name, '/')) ? np+1 : name);
  2014. X! #  endif /* TOS && __GNUC__ */
  2015. X  }
  2016. X  
  2017. X  int
  2018. X! uptodate(fd) {
  2019. X! #  if defined(TOS) && !defined(__GNUC__) /* no fstat yet */
  2020. X      if(fstat(fd, &buf)) {
  2021. X      pline("Cannot get status of saved level? ");
  2022. X      return(0);
  2023. X--- 138,151 ----
  2024. X      path = np + 1;
  2025. X      }
  2026. X      error("Cannot get status of %s.", (np = rindex(name, '/')) ? np+1 : name);
  2027. X! # endif /* WANT_GETHDATE */
  2028. X  }
  2029. X  
  2030. X  int
  2031. X! uptodate(fd)
  2032. X! int fd;
  2033. X! {
  2034. X! # ifdef WANT_GETHDATE
  2035. X      if(fstat(fd, &buf)) {
  2036. X      pline("Cannot get status of saved level? ");
  2037. X      return(0);
  2038. X***************
  2039. X*** 155,177 ****
  2040. X      pline("Saved level is out of date. ");
  2041. X      return(0);
  2042. X      }
  2043. X! #  endif
  2044. X      return(1);
  2045. X  }
  2046. X! # endif    /* MACOS /* */
  2047. X! #endif /* OLD_TOS /* */
  2048. X  
  2049. X  void
  2050. X  regularize(s)
  2051. X!     /* normalize file name - we don't like .'s, /'s, :'s [Mac], or spaces */
  2052. X  register char *s;
  2053. X  {
  2054. X      register char *lp;
  2055. X  
  2056. X      while((lp=index(s, '.')) || (lp=index(s, '/')) || (lp=index(s,' '))
  2057. X! #ifdef MACOS
  2058. X!             || (lp=index(s, ':'))
  2059. X  #endif
  2060. X-                                 )
  2061. X-         *lp = '_';
  2062. X  }
  2063. X--- 154,203 ----
  2064. X      pline("Saved level is out of date. ");
  2065. X      return(0);
  2066. X      }
  2067. X! # else
  2068. X! #  if defined(MSDOS) && !defined(NO_FSTAT)
  2069. X!     if(fstat(fd, &buf)) {
  2070. X!     if(moves > 1) pline("Cannot get status of saved level? ");
  2071. X!     else pline("Cannot get status of saved game");
  2072. X!     return(0);
  2073. X!     } 
  2074. X!     if(comp_times(buf.st_mtime)) { 
  2075. X!     if(moves > 1) pline("Saved level is out of date");
  2076. X!     else pline("Saved game is out of date. ");
  2077. X!     return(0);
  2078. X!     }
  2079. X! #  endif  /* MSDOS /* */
  2080. X! # endif /* WANT_GETHDATE */
  2081. X      return(1);
  2082. X  }
  2083. X! #endif    /* MACOS /* */
  2084. X  
  2085. X  void
  2086. X  regularize(s)
  2087. X! /*
  2088. X!  * normalize file name - we don't like .'s, /'s, :'s [Mac], or spaces,
  2089. X!  * and in msdos / OS/2 we really get picky
  2090. X!  */
  2091. X  register char *s;
  2092. X  {
  2093. X      register char *lp;
  2094. X  
  2095. X+ #ifdef MSDOS
  2096. X+     for (lp = s; *lp; lp++)
  2097. X+         if (*lp <= ' ' || *lp == '"' || (*lp >= '*' && *lp <= ',') ||
  2098. X+             *lp == '.' || *lp == '/' || (*lp >= ':' && *lp <= '?') ||
  2099. X+ # ifdef OS2
  2100. X+             *lp == '&' || *lp == '(' || *lp == ')' ||
  2101. X+ # endif
  2102. X+             *lp == '|' || *lp >= 127 || (*lp >= '[' && *lp <= ']'))
  2103. X+                         *lp = '_';
  2104. X+ #else
  2105. X      while((lp=index(s, '.')) || (lp=index(s, '/')) || (lp=index(s,' '))
  2106. X! # ifdef MACOS
  2107. X!        || (lp=index(s, ':'))
  2108. X! # endif
  2109. X!         ) *lp = '_';
  2110. X  #endif
  2111. X  }
  2112. X+ 
  2113. X+ #endif /* OVLB */
  2114. X*** others/Old/random.c    Mon Feb 19 23:35:59 1990
  2115. X--- others/random.c    Fri Feb 16 23:01:50 1990
  2116. X***************
  2117. X*** 15,22 ****
  2118. X   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  2119. X   */
  2120. X  
  2121. X! #if defined(LIBC_SCCS) && !defined(lint)
  2122. X  static char sccsid[] = "@(#)random.c    5.5 (Berkeley) 7/6/88";
  2123. X  #endif /* LIBC_SCCS and not lint */
  2124. X  
  2125. X  #include <stdio.h>
  2126. X--- 15,34 ----
  2127. X   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  2128. X   */
  2129. X  
  2130. X! /* Several minor changes were made for the NetHack distribution to satisfy
  2131. X!  * non-BSD compilers (by definition BSD compilers do not need to compile
  2132. X!  * this file for NetHack).  These changes consisted of:
  2133. X!  *    - changing the sccsid conditions to nested ifdefs from defined()s
  2134. X!  *    to accommodate stupid preprocessors
  2135. X!  *    - giving srandom() type void instead of allowing it to default to int
  2136. X!  *    - making the first return in initstate() return a value consistent
  2137. X!  *    with its type (instead of no value)
  2138. X!  */
  2139. X! 
  2140. X! #ifdef LIBC_SCCS
  2141. X! # ifndef lint
  2142. X  static char sccsid[] = "@(#)random.c    5.5 (Berkeley) 7/6/88";
  2143. X+ # endif
  2144. X  #endif /* LIBC_SCCS and not lint */
  2145. X  
  2146. X  #include <stdio.h>
  2147. X***************
  2148. X*** 182,187 ****
  2149. X--- 194,200 ----
  2150. X   * values produced by this routine.
  2151. X   */
  2152. X  
  2153. X+ void
  2154. X  srandom( x )
  2155. X  
  2156. X      unsigned        x;
  2157. X***************
  2158. X*** 236,242 ****
  2159. X      if(  n  <  BREAK_1  )  {
  2160. X          if(  n  <  BREAK_0  )  {
  2161. X          fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n", n );
  2162. X!         return;
  2163. X          }
  2164. X          rand_type = TYPE_0;
  2165. X          rand_deg = DEG_0;
  2166. X--- 249,255 ----
  2167. X      if(  n  <  BREAK_1  )  {
  2168. X          if(  n  <  BREAK_0  )  {
  2169. X          fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n", n );
  2170. X!         return (char *)0;
  2171. X          }
  2172. X          rand_type = TYPE_0;
  2173. X          rand_deg = DEG_0;
  2174. X*** others/Old/trampoli.c    Mon Feb 19 23:37:13 1990
  2175. X--- others/trampoli.c    Wed Feb  7 18:39:42 1990
  2176. X***************
  2177. X*** 39,44 ****
  2178. X--- 39,50 ----
  2179. X  #undef domonability
  2180. X  #endif /* POLYSELF */
  2181. X  
  2182. X+ #ifdef EXPLORE_MODE
  2183. X+ #undef enter_explore_mode
  2184. X+ 
  2185. X+ int enter_explore_mode() { return enter_explore_mode_(); }
  2186. X+ #endif
  2187. X+ 
  2188. X  #undef timed_occupation
  2189. X  
  2190. X  #if defined(WIZARD) || defined(EXPLORE_MODE)
  2191. X***************
  2192. X*** 131,137 ****
  2193. X  int Boots_off()   { return Boots_off_();   }
  2194. X  int Gloves_off()  { return Gloves_off_();  }
  2195. X  int Helmet_off()  { return Helmet_off_();  }
  2196. X! /* int Armor_on()    { return Armor_on_();    } */
  2197. X  int Boots_on()    { return Boots_on_();    }
  2198. X  int Gloves_on()   { return Gloves_on_();   }
  2199. X  int Helmet_on()   { return Helmet_on_();   }
  2200. X--- 137,143 ----
  2201. X  int Boots_off()   { return Boots_off_();   }
  2202. X  int Gloves_off()  { return Gloves_off_();  }
  2203. X  int Helmet_off()  { return Helmet_off_();  }
  2204. X! int Armor_on()    { return Armor_on_();    }
  2205. X  int Boots_on()    { return Boots_on_();    }
  2206. X  int Gloves_on()   { return Gloves_on_();   }
  2207. X  int Helmet_on()   { return Helmet_on_();   }
  2208. X***************
  2209. X*** 173,180 ****
  2210. X--- 179,188 ----
  2211. X  
  2212. X  
  2213. X  /* ### end.c ### */
  2214. X+ #undef done1
  2215. X  #undef done2
  2216. X  
  2217. X+ int done1() { return done1_(); }
  2218. X  int done2() { return done2_(); }
  2219. X  
  2220. X  
  2221. X***************
  2222. X*** 241,246 ****
  2223. X--- 249,259 ----
  2224. X  int forcelock() { return forcelock_(); }
  2225. X  int picklock()  { return picklock_();  }
  2226. X  
  2227. X+ /* ### mondata.c ### */
  2228. X+ #undef canseemon
  2229. X+ 
  2230. X+ boolean canseemon(x) struct monst *x; { return canseemon_(x); }
  2231. X+ 
  2232. X  
  2233. X  /* ### o_init.c ### */
  2234. X  #undef dodiscovered
  2235. X***************
  2236. X*** 290,296 ****
  2237. X  #undef in_container
  2238. X  #undef out_container
  2239. X  
  2240. X! int ck_bag()  { return ck_bag_();  }
  2241. X  int ck_container(obj)  struct obj *obj; { return ck_container_(obj); }
  2242. X  int doloot() { return doloot_(); }
  2243. X  int in_container(obj)  struct obj *obj; { return in_container_(obj); }
  2244. X--- 303,309 ----
  2245. X  #undef in_container
  2246. X  #undef out_container
  2247. X  
  2248. X! int ck_bag(obj) struct obj *obj; { return ck_bag_(obj);  }
  2249. X  int ck_container(obj)  struct obj *obj; { return ck_container_(obj); }
  2250. X  int doloot() { return doloot_(); }
  2251. X  int in_container(obj)  struct obj *obj; { return in_container_(obj); }
  2252. X***************
  2253. X*** 398,405 ****
  2254. X--- 411,420 ----
  2255. X  
  2256. X  /* ### version.c ### */
  2257. X  #undef doversion
  2258. X+ #undef doextversion
  2259. X  
  2260. X  int doversion() { return doversion_(); }
  2261. X+ int doextversion() { return doextversion_(); }
  2262. X  
  2263. X  
  2264. X  /* ### wield.c ### */
  2265. X
  2266. END_OF_FILE
  2267. if test 53640 -ne `wc -c <'patch7.21'`; then
  2268.     echo shar: \"'patch7.21'\" unpacked with wrong size!
  2269. fi
  2270. # end of 'patch7.21'
  2271. echo shar: End of archive 16 \(of 30\).
  2272. cp /dev/null ark16isdone
  2273. MISSING=""
  2274. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do
  2275.     if test ! -f ark${I}isdone ; then
  2276.     MISSING="${MISSING} ${I}"
  2277.     fi
  2278. done
  2279. if test "${MISSING}" = "" ; then
  2280.     echo You have unpacked all 30 archives.
  2281.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2282. else
  2283.     echo You still need to unpack the following archives:
  2284.     echo "        " ${MISSING}
  2285. fi
  2286. ##  End of shell archive.
  2287. exit 0
  2288.